package com.lagou.service.impl;

import com.lagou.service.HelloService;
import io.netty.util.internal.MathUtil;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;

import javax.sound.midi.Soundbank;
import java.util.Map;
import java.util.Random;

@Service
public class HelloServiceImpl implements HelloService {

    @Override
    public String sayHello01(String name, int timeToWait) {
        Random random = new Random();
        int i = random.nextInt(1000);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "hello01:" + name;
    }

    @Override
    public String sayHello02(String name, int timeToWait) {
        Random random = new Random();
        int i = random.nextInt(1000);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "hello02:" + name;
    }

    @Override
    public String sayHello03(String name, int timeToWait) {
        Random random = new Random();
        int i = random.nextInt(1000);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "hello03:" + name;
    }
}
